package cn.dao.Impl;

import cn.base.Impl.IBaseDaoImpl;
import cn.dao.ReplyDao;
import cn.domain.PageBean;
import cn.domain.Reply;
import cn.domain.Topic;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2017/4/7 0007.
 */
@Repository
public class ReplyDaoImpl extends IBaseDaoImpl<Reply> implements ReplyDao{
    @Override
    public void save(Reply entity) {
        Topic topic=entity.getTopic();
        topic.setLastReply(entity);
        entity.setTopic(topic);
        super.save(entity);
    }

}
